package com.tosmart.jorm.face;

/**
 * Jorm framework supports the use of optimistic
 * locking on the Entity class, use this tag to
 * provide the column name of optimistic locking
 * version field of the Entity class to the framework.
 * <p/>
 * An Entity class use optimistic Lock muse implements
 * this interface.
 * <p/>
 * The Limit will be validation before createEntity.
 */
public interface OptimisticLockSupport {
    /**
     * The setter of the optimistic lock version filed.
     *
     * @param version the current lock version
     */
    void setVersion(long version);

    /**
     * The getter of the optimistic lock version filed.
     *
     * @return the lock version
     */
    long getVersion();
}
